package com.an.blog.strategy;


import com.an.blog.web.domain.BlogBindBo;
import com.an.common.core.domain.entity.SysUser;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthUser;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 社会登录回调策略
 *
 * @author: Ann
 * @createDate: 2023/09/01 14:16:31
 * @version: 1.0.0
 */
public interface SocialLoginStrategy {

    /**
     * 社会登录回电话
     *
     * @param response        响应
     * @param callback        回调
     * @param servletResponse servlet响应
     * @throws IOException io异常
     * @author Ann
     * @date 2024/06/04
     */
    void socialLoginCallBack(AuthResponse<AuthUser> response, AuthCallback callback,
                             HttpServletResponse servletResponse) throws IOException;

    /**
     * 登录绑定社交用户
     *
     * @param blogBindBo 博客绑定参数
     * @param sysUser       系统用户
     * @param blogBindBo 博客绑定参数
     * @param sysUser       系统用户
     * @return
     * @author: Ann
     * @createDate: 2023/09/04 08:51:28
     */
    void loginBindSocialUser(BlogBindBo blogBindBo, SysUser sysUser);

    /**
     * 注册绑定社交用户
     *
     * @param blogBindBo 博客绑定参数
     * @param sysUser       系统用户
     * @return {@link AuthUser }
     * @author Ann
     * @date 2024/06/04
     */
    AuthUser registerBindSocialUser(BlogBindBo blogBindBo, SysUser sysUser);
}
